package com.st.lwb.dao;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class ContactDao extends SQLiteOpenHelper {

	public ContactDao(Context context) {
		super(context, "mycontact.db", null, 1);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		String cmd = "Create  TABLE mycontact_data([contactId] int PRIMARY KEY NOT NULL,[pinyin] varchar(50)," +
				"[formattedNumber] varchar(50),[selected] int,[lookUpKey] varchar(50),[photoId] int," +
				"[sortKey] varchar(50),[phoneNum] varchar(50),[displayName] varchar(50));";
		
		String cmd2 = "Create  TABLE my_data1(contactId varchar(50) PRIMARY KEY NOT NULL,[note] varchar(50)," +
				"[organization] varchar(50),[website] varchar(50),[lunarBirthday] varchar(50)," +
				"[address] varchar(50),[email] varchar(50));";
		
		db.execSQL(cmd);
		db.execSQL(cmd2);
	}

	@Override
	public void onUpgrade(SQLiteDatabase arg0, int arg1, int arg2) {

	}

}
